home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / DOCZ16.ZIP;1 / DOCZ.LIF / DOCREVS.SH < prev    next >
Encoding:
Text File  |  1994-04-24  |  5.5 KB  |  183 lines

  1. # **********************************************************************
  2. # docrevs
  3. #
  4. # This script uses the DOCZ utilities to determine if there are any
  5. # revisions, introductions, or fixes in the libraries.  The documentation
  6. # is generated, deposited in $DAT, and a notice is mailed to a mailing
  7. # list and posted to a local newsgroup.
  8. #
  9. # This script should be run early in the day once a week.
  10. # **********************************************************************
  11.  
  12. # defines DOCZ symbols and modifies PATH (if required)
  13. . /usr2/common/bin/syms
  14.  
  15. # DOCZ administrator on this system
  16. MANAGER=todd
  17. # mailing list
  18. MAILIST=$DAT/docs.lis
  19. # reference date file
  20. REFDATE=$DAT/docrevs.dat
  21. # temporary announcement file
  22. ANNOUNCE=/usr/tmp/docrevs.not
  23. # temporary error report for administrator
  24. ERRORS=/usr/tmp/docrevs.err
  25. # this is the name for the file containing the revision notices
  26. NOTICE="$DAT/REV.`calcdate | sed 's/\///g'`"
  27. # this is the name for the file containing the revision summaries
  28. SUMMARY="$DAT/SUM.`calcdate | sed 's/\///g'`"
  29. # this is the name of the ASCII Transport File for help
  30. TRANSPORT="$DAT/dochelp.txt"
  31. # list of libraries
  32. LIBLIST="CSUB UTIL DOCZ CURSLIB TOOLZ DOCLIB"
  33.  
  34. rm $SUMMARY
  35. rm $NOTICE
  36. rm $ERRORS
  37. rm $TRANSPORT
  38.  
  39. # **********************************************************************
  40. # this function produces the basic notices for any DOCZ library
  41. # Modification notices are not performed (doc /m)
  42. do_doc()
  43. {
  44.    LIBNAME=`echo $1 | tr "[a-z]" "[A-Z]"`    # make upper case
  45.     echo Producing $LIBNAME Revisions
  46.     doc $LIBNAME -r=`cat $REFDATE` -s 2>>$ERRORS
  47.     if [ $? -eq 0 ]
  48.     then
  49.        cat $LIBNAME.DOC >> $NOTICE
  50.        rm $LIBNAME.DOC
  51.         echo $LIBNAME Revision Summary >> $ANNOUNCE
  52.         cat $LIBNAME.REV >> $ANNOUNCE
  53.         echo $LIBNAME Revision Summary >> $SUMMARY
  54.         cat $LIBNAME.REV >> $SUMMARY
  55.         rm $LIBNAME.REV
  56.        echo "> $LIBNAME Revision Notice = $NOTICE" >> $ANNOUNCE
  57.     else
  58.        echo "No $LIBNAME revisions since `cat $REFDATE`" >> $ANNOUNCE
  59.     fi
  60.     
  61.     echo Producing $LIBNAME Introductions
  62.     doc $LIBNAME -i=`cat $REFDATE` -s 2>>$ERRORS
  63.     if [ $? -eq 0 ]
  64.     then
  65.        cat $LIBNAME.DOC >> $NOTICE
  66.        rm $LIBNAME.DOC
  67.         echo $LIBNAME Introduction Summary >> $ANNOUNCE
  68.         cat $LIBNAME.INT >> $ANNOUNCE
  69.         echo $LIBNAME Introduction Summary >> $SUMMARY
  70.         cat $LIBNAME.INT >> $SUMMARY
  71.         rm $LIBNAME.INT
  72.        echo "> $LIBNAME Introduction Notice = $NOTICE" >> $ANNOUNCE
  73.     else
  74.        echo "No $LIBNAME introductions since `cat $REFDATE`" >> $ANNOUNCE
  75.     fi
  76.     
  77.     echo Producing $LIBNAME Fixes
  78.     doc $LIBNAME -f=`cat $REFDATE` -s 2>>$ERRORS
  79.     if [ $? -eq 0 ]
  80.     then
  81.        cat $LIBNAME.DOC >> $NOTICE
  82.        rm $LIBNAME.DOC
  83.         echo $LIBNAME Fix Summary >> $ANNOUNCE
  84.         cat $LIBNAME.FIX >> $ANNOUNCE
  85.         echo $LIBNAME Fix Summary >> $SUMMARY
  86.         cat $LIBNAME.FIX >> $SUMMARY
  87.         rm $LIBNAME.FIX
  88.        echo "> $LIBNAME Fix Notice = $NOTICE" >> $ANNOUNCE
  89.     else
  90.        echo "No $LIBNAME fixes since `cat $REFDATE`" >> $ANNOUNCE
  91.     fi
  92.     if [ -r $LIBNAME.ERR ]
  93.     then
  94.        mail $MANAGER <$LIBNAME.ERR
  95.        rm $LIBNAME.ERR
  96.     fi
  97.     
  98. }
  99.  
  100. # real work begins here
  101. # **********************************************************************
  102. # create the announcement file
  103. if [ ! -r $REFDATE ]             # new file
  104. then
  105.    calcdate > $REFDATE
  106. fi
  107. echo "`calcdate` Revision, Fix, and Introduction Notices since `cat $REFDATE`\n" > $ANNOUNCE
  108. echo Producing REVISION NOTICES `cat $REFDATE`
  109.  
  110. # **********************************************************************
  111. # add library names here
  112.  
  113. for i in $LIBLIST
  114. do
  115.     do_doc $i
  116. done
  117.  
  118. # **********************************************************************
  119. # distribute the announcement, if present
  120. if [ -r $NOTICE ]
  121. then
  122.    echo "\nNote:  $NOTICE is print-image for HP-Laser-Jet" >> $ANNOUNCE
  123. fi
  124.  
  125. # **********************************************************************
  126. # post the notice locally to News
  127. if [ -r $ANNOUNCE ]
  128. then
  129. /usr3/news/lib/inews \
  130.    -t 'Library Revision Notice' \
  131.    -n local.post  \
  132.    -d local \
  133.    -h \
  134.    -r emory\!toolz\!todd \
  135.    < $ANNOUNCE
  136.  
  137. # **********************************************************************
  138. # mail the notice to a mailing list (this requires the 'mailist' script)
  139.     mailist "Periodic Library Revision Notice" $MAILIST $ANNOUNCE
  140.  
  141. # **********************************************************************
  142. # mail the notice to the MANAGER
  143.     mailx -s "WEEKLY: Periodic Library Revision Notice" $MANAGER <$ANNOUNCE
  144.     rm $ANNOUNCE
  145. fi
  146.  
  147. # **********************************************************************
  148. # update the reference date
  149. calcdate -o=$REFDATE  # update last revision date
  150. echo Reference date updated to `cat $REFDATE`
  151.  
  152. # **********************************************************************
  153. # mail the errors to the MANAGER
  154. if [ -f $ERRORS ]
  155. then
  156.    mailx -s "WEEKLY: DOCZ errors" $MANAGER <$ERRORS
  157.    rm $ERRORS
  158. fi
  159.  
  160. # **********************************************************************
  161. # verify the presence of all files
  162. docxlu -v=$ERRORS
  163. mailx -s "WEEKLY: DOCZ source verification" $MANAGER <$ERRORS
  164. rm $ERRORS
  165.  
  166. # **********************************************************************
  167. # search for rogue files
  168. for i in $LIBLIST
  169. do
  170.     docxlu $i -c=/usr/tmp/$i.z
  171.     echo $i >>$ERRORS
  172.     cat /usr/tmp/$i.z >>$ERRORS
  173.     rm /usr/tmp/$i.z
  174. done
  175. mailx -s "WEEKLY: DOCZ search for rogue files" $MANAGER <$ERRORS
  176. rm $ERRORS
  177.  
  178. # **********************************************************************
  179. # re-build on-line help library (this is a killer with version control!)
  180. dochbld -h -ao=$TRANSPORT
  181.  
  182. #
  183.